<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .timeBox{
      width: 300px;
      height: 150px;
      background: #000;
      color: #fff;
      margin: 0 auto;
      text-align: center;
      line-height: 50px;
      padding-top: 25px;
      box-sizing: border-box;
    }
    input{
      width: 30px;
      margin: 10px;
      text-align: center;
    }
    .btn{
      width: 200px;
      height: 40px;
      background: green;
      color: #fff;
      font-size: 18px;
      cursor: pointer;
    }
  </style>
</head>
<body>
  <div class="timeBox">
    <input type="text" class="minutes" value="01">分
    <input type="text" class="second" value="10">秒<br />
    <button class="btn">启动</button>
  </div>
</body>
<script>
  var btn=document.querySelector('.btn')
  var min=document.querySelector('.minutes')
  var sec=document.querySelector('.second')
  btn.onclick=function(){
    this.style.background="red"
    this.innerHTML="取消"
    var minVal=min.value
    var secVal=sec.value
   let time=setInterval(()=>{
      sec.value--
      if(sec.value==0){
        min.value='00'
        sec.value="60"
        clearInterval(time)
      }
    },1000)
  }
</script>
</html>